package cn.edu.sdjzu.xg.eagle.service.impl;

import cn.edu.sdjzu.xg.eagle.entities.ClubApplication;
import cn.edu.sdjzu.xg.eagle.mapper.ClubApplicationMapper;
import cn.edu.sdjzu.xg.eagle.service.ClubApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ClubApplicationServiceImpl implements ClubApplicationService {

    @Autowired
    private ClubApplicationMapper clubApplicationMapper;

    @Override
    public List<ClubApplication> findAllClubApplications() {
        return clubApplicationMapper.findAllClubApplications();
    }

    @Override
    public ClubApplication findClubApplicationByIdAndTime(Integer applicantId, java.util.Date applyTime) {
        return clubApplicationMapper.findClubApplicationByIdAndTime(applicantId, applyTime);
    }

    @Override
    @Transactional
    public int addClubApplication(ClubApplication clubApplication) {
        return clubApplicationMapper.addClubApplication(clubApplication);
    }

    @Override
    @Transactional
    public int updateClubApplication(ClubApplication clubApplication) {
        return clubApplicationMapper.updateClubApplication(clubApplication);
    }

    @Override
    @Transactional
    public int deleteClubApplication(Integer applicantId, java.util.Date applyTime) {
        return clubApplicationMapper.deleteClubApplication(applicantId, applyTime);
    }
}